function increase_vote(post_id, vote_key)
{
	var id ='#voting' + post_id + vote_key
	var postdata='post_id='+post_id+'&type=increase-post';
	$(id).html("<img src='/images/voting-load.gif'  />");
	$.ajax({type: "POST",url: "/ajax/vote.php",data: postdata,success: function(msg){$(id).html(msg);}});
}

function decrease_vote(post_id, vote_key)
{
	var id ='#voting' + post_id + vote_key
	var postdata='post_id='+post_id+'&type=decrease-post';
	$(id).html("<img src='/images/voting-load.gif'  />");
	$.ajax({type: "POST",url: "/ajax/vote.php",data: postdata,success: function(msg){$(id).html(msg);}});
}

function increase_user_vote(user_id)
{
	var id ='#voting' + user_id;
	var postdata='user_id='+user_id+'&type=increase-post';
	$(id).html("<img src='/images/voting-load.gif'  />");
	$.ajax({type: "POST",url: "/ajax/userVote.php",data: postdata,success: function(msg){$(id).html(msg);}});
}

function decrease_user_vote(user_id)
{
	var id ='#voting' + user_id;
	var postdata='user_id='+user_id+'&type=decrease-post';
	$(id).html("<img src='/images/voting-load.gif'  />");
	$.ajax({type: "POST",url: "/ajax/userVote.php",data: postdata,success: function(msg){$(id).html(msg);}});
}

function increase_comment_vote(comment_id)
{
	var id ='#comment-voting' + comment_id;
	var postdata='comment_id='+comment_id+'&type=increase-comment';
	$(id).html("<img src='/images/voting-load.gif'  />");
	$.ajax({type: "POST",url: "/ajax/vote.php",data: postdata,success: function(msg){$(id).html(msg);}});
}

function decrease_comment_vote(comment_id)
{
	var id ='#comment-voting' + comment_id;
	var postdata='comment_id='+comment_id+'&type=decrease-comment';
	$(id).html("<img src='/images/voting-load.gif'  />");
	$.ajax({type: "POST",url: "/ajax/vote.php",data: postdata,success: function(msg){$(id).html(msg);}});
}

function showReason(text)
{
	var div=document.getElementById(text);
	div.style.display="block";
}

function hideReason(text)
{
	var div=document.getElementById(text);
	div.style.display="none";
}

function flag_post(post_id, reason)
{
	var id ='#flagging' + post_id;
	var postdata='post_id='+post_id+'&reason='+reason+'&type=flag-post';
	$(id).html("<img src='/images/voting-load.gif'  />");
	$.ajax({type: "POST",url: "/ajax/vote.php",data: postdata,success: function(msg){$(id).html(msg);}});
}

function flag_comment(comment_id, reason)
{
	var id ='#flagging' + comment_id;
	var postdata='comment_id='+comment_id+'&reason='+reason+'&type=flag-comment';
	$(id).html("<img src='/images/voting-load.gif'  />");
	$.ajax({type: "POST",url: "/ajax/vote.php",data: postdata,success: function(msg){$(id).html(msg);}});
}
